DEFINITION MODULE Excard;

(*              Definitionsmodul Excard Version 1.0                   *
 *       Copyright: K. Hartlage, Pr.Stroehen 194, 4993 Rahden         *
 * Berechnung (Ex-)tra langer (Card-)inalzahlen;                      *
 * Verbesserungen, Berichtigungen und eigene Anwendungen bitte an die *
 * obige Adresse senden                                               *)

FROM  SYSTEM IMPORT ADDRESS;

CONST ExCardLen    =  416;
      ExCardDigits = 2000; (* Anzahl Zeichen *)

TYPE        ExCard = RECORD
                       length:CARDINAL;
                       (* Laenge der Zahl *)
                       number:ARRAY [0..ExCardLen-1] OF CARDINAL;
                       (* eigentliche Darstellung der Zahl *)
                     END;
(* a=0 genau dann wenn a.length=1 a.number[0]=0;
   a=1 genau dann wenn a.length=1 a.number[0]=1 usw. *)

PROCEDURE Def(VAR a : ExCard; b : ADDRESS);

PROCEDURE CardToExCard(VAR a : ExCard; b : CARDINAL);

PROCEDURE ExEqual(VAR a,b : ExCard) : BOOLEAN;

PROCEDURE ExLess(VAR a,b : ExCard) : BOOLEAN;

PROCEDURE ExOdd(VAR a : ExCard) : BOOLEAN;
 
PROCEDURE ExInc(VAR a : ExCard);

PROCEDURE ExDec(VAR a : ExCard);

PROCEDURE ExAdd(VAR sum,a,b : ExCard);

PROCEDURE ExSub(VAR diff,a,b: ExCard);

PROCEDURE ExShl(VAR a : ExCard);

PROCEDURE ExShr(VAR a : ExCard):BOOLEAN;

PROCEDURE ExMul(VAR prod,a,b :ExCard);

PROCEDURE ExDiv(VAR quot,a,b :ExCard);

PROCEDURE ExMod(VAR rest,a,b :ExCard);

PROCEDURE ExRead(VAR a : ExCard);

PROCEDURE ExWrite( a : ExCard);

END Excard.
